/*
 * @Author: liuying 247220246@qq.com
 * @Date: 2024-12-30 14:38:54
 * @LastEditors: liuying 247220246@qq.com
 * @LastEditTime: 2025-01-02 17:02:17
 * @FilePath: \my-book-react\src\bases\spinner-loading\index.tsx
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import React from 'react';
import cx from 'classnames';
import './styles/index.scss';

export interface SpinnerLoadingProps {
  color?: 'default' | 'primary' | 'white';
  size?: number;
  style?: React.CSSProperties;
}

const classPrefix = 'ygm-spinner-loading';

const SpinnerLoading: React.FC<SpinnerLoadingProps> = (props) => {
  return (
    <div
      className={cx(`${classPrefix}`, `${classPrefix}-color-${props.color}`)}
      style={{ ...props.style, width: props.size, height: props.size }}
    />
  );
};

SpinnerLoading.defaultProps = {
  color: 'default',
  size: 32,
};

export default SpinnerLoading;

SpinnerLoading.displayName = 'SpinnerLoading';
